bpo-45155 : Default arguments for int.to_bytes(length=1, byteorder=sys.byteorder)#28265
bpo-45155 : Default arguments for int.to_bytes(length=1, byteorder=sys.byteorder)#28265warsaw merged 19 commits intopython:mainfrom
Conversation
|
This is a nice improvement. Thanks. |
ericvsmith
left a comment
There was a problem hiding this comment.
This all looks reasonable to me. But .format() instead of f-strings? What?!
|
The main docs need to be updated as well: https://docs.python.org/3/library/stdtypes.html?highlight=to_bytes#int.to_bytes |
Ha! I knew you'd say that 😆
Yep, thanks @rhettinger ... coming up! |
|
Also consider updating the default byteorder for int.from_bytes. The to/from round trip should be as symmetrical as possible. |
brandtbucher
left a comment
There was a problem hiding this comment.
Beat me to it! I agree that int.from_bytes deserves the same treatment, too.
I also saw one possible improvement:
|
Please, for the sake of reproducible science (and other cases), don't add platform-dependent defaults. |
Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
|
When you're done making the requested changes, leave the comment: |
Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
|
I have made the requested changes; please review again. |
|
Thanks for making the requested changes! @brandtbucher: please review the changes made to this pull request. |
brandtbucher
left a comment
There was a problem hiding this comment.
Looks good! Just one RST nit:
Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
|
|
brandtbucher
left a comment
There was a problem hiding this comment.
I think you missed some!
|
When you're done making the requested changes, leave the comment: |
Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
…55.JRw9TG.rst Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
|
Thanks for catching the ones I missed @brandtbucher |
|
I have made the requested changes; please review again. |
|
Thanks for making the requested changes! @brandtbucher: please review the changes made to this pull request. |
brandtbucher
left a comment
There was a problem hiding this comment.
Sorry, I promise this is my last review!
Just realized that we can help AC give us a better __text_signature__ (for help, inspect, etc.). Other than that improvement, this looks good!
Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
|
(I think you need to re-run AC locally, too.) |
|
@warsaw: Please replace |
In the PEP 467 discussion, I proposed being able to use
IOW, adding default arguments for the
lengthandbyteorderarguments toint.to_bytes()It occurs to me that this is (1) useful on its own merits; (2) easy to do. So I've done it.
https://bugs.python.org/issue45155